package com.lagou.task03;
/**
 *
 * 通话套餐类型：
 * 特征：通话时长、短信条数、每月资费
 * 行为：显示所有套餐信息
 *
 * */
public class CallMeal extends AbstractMeal implements CallService {

    //通话时长
    private int callMinute;

    //短信条数
    private int messagesNum;

    public int getCallMinute() {
        return callMinute;
    }

    public void setCallMinute(int callMinute) {
        if (callMinute < 0){
            System.out.println("数值不合理");
        }else{
            this.callMinute = callMinute;
        }
    }

    public int getMessagesNum() {
        return messagesNum;
    }

    public void setMessagesNum(int messagesNum) {
        if (messagesNum < 0){
            System.out.println("数值不合理");
        }else {
            this.messagesNum = messagesNum;
        }
    }


    public void show(){
        System.out.println("当前通话套餐：\n" + "通话时长：" + callMinute + "分钟");
        System.out.println("短信条数" + messagesNum +"条");
        System.out.println("每月资费" + getMealPrice() + "元");
    }

    //实现通话服务接口
    @Override
    public void call(int callMinute, SIMCard card) {
        System.out.println("用户通话");
    }
}
